const baseHead = "/childhealth/"

function sendRequset(request, success, error) {
    $.ajax({
        // headers: {
        //     "token":""
        // }
        url: baseHead + request.url,
        data: request.data || null,
        method: request.method || 'GET',
        async: request.async || true,
        timeout: request.timeout || 5000,
        success(data) {
            success && success(data)
        },
        error(data) {
            error && error(data)
            error || console.log(data.responseJson)
        }

    })

}